package com.uwo.commons.environment;

import org.springframework.context.EnvironmentAware;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

/**
 * Created by yanhao on 2018/4/9.
 */
@Configuration
public class TestEnvironmentAware implements EnvironmentAware {


    @Override
    public void setEnvironment(Environment environment) {
        System.out.println("========");
        String[] profiles = environment.getActiveProfiles();
        for (String profile: profiles) {
            System.out.println(profile);
        }

    }

}
